﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using 通用类库.Utils;
using 通用类库.DataProvider;
using 通用类库.Stock;


namespace II限价交易类库                                  // II限价交易类库 是类名称, 这个类名包含在namespace 的命名空间中
{
    public partial class 限价交易 : UserControl       //限价交易是子窗体        
    {
            public 限价交易()
            {
            InitializeComponent();
           
            }

        //要求股票代码，股票名称全局同步，
        // 输入完股票代码立即在股票名称文本框内显示对应的股票名称
        private void 股票代码3_TextChanged(object sender, EventArgs e)                                        //股票代码3
            {
            string strTmp = StockCache.Instance.GetStockName(this.股票代码3.Text);                        //在代码文本框内输入股票代码
            this.股票名称3.Text = strTmp;
            GlobalInstanceCache.Instance.DataInstance.SubscribeStock(this.股票代码3.Text);
            }

        //要求股票代码，股票名称全局同步
        // 输入完股票代码立即在股票名称文本框内显示对应的股票名称
        private void 股票代码4_TextChanged(object sender, EventArgs e)                                        //股票代码4
            {
            string strTmp = StockCache.Instance.GetStockName(this.股票代码4.Text);                        //在代码文本框内输入股票代码
            this.股票名称4.Text = strTmp;
            GlobalInstanceCache.Instance.DataInstance.SubscribeStock(this.股票代码4.Text);
            }


        //下面写输入完股票名称后，立即在股票代码文本框中显示对应的股票代码
        public void SetStockCode(string text)
        {
        this.股票代码3.Text = text;
        this.股票代码4.Text = text;
        string strTmp = StockCache.Instance.GetStockName(this.股票代码4.Text);
        this.股票名称3.Text = strTmp;
        this.股票名称4.Text = strTmp;
        StockLevel2Info PriceInfo = StockCache.Instance.GetStockPrice(this.股票代码3.Text);
        股票代码3_TextChanged(null, null);
        股票代码4_TextChanged(null, null);
        }



       private void 卖出价格1_TextChanged(object sender, EventArgs e)
        {

        }

        private void 卖出仓位1_TextChanged(object sender, EventArgs e)
        {

        }

        private void 有效期1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void 添加1_Click(object sender, EventArgs e)
        {

        }

        private void 修改1_Click(object sender, EventArgs e)
        {

        }

        private void 删除1_Click(object sender, EventArgs e)
        {

        }

        private void 表格3_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

       

        private void 买入价格1_TextChanged(object sender, EventArgs e)
        {

        }

        private void 买入仓位1_TextChanged(object sender, EventArgs e)
        {

        }

        private void 有效期2_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void 添加2_Click(object sender, EventArgs e)
        {

        }

        private void 修改2_Click(object sender, EventArgs e)
        {

        }

        private void 删除2_Click(object sender, EventArgs e)
        {

        }

        private void 表格4_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }
    }
}
